<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Mixins 混入选项操作</title>
  <script src="../assets/js/vue.js"></script>
</head>

<body>
  <h1>Mixins 混入选项操作</h1>
  <hr>
  <div id="app">
    {{num}}
    ${num}
    <p>
      <button @click="add">add</button>
    </p>
  </div>
  <script type="text/javascript">
    var extendsObj = {
      updated: function () {
        console.log("我是扩展的updated");
      },
      methods: {
        add: function () {
          console.log('我是扩展的方法');
          this.num++;
        }
      }
    }

    var app = new Vue({
      el: '#app',
      data: {
        num: 1
      },
      methods: {
        add: function () {
          console.log('我是原生的方法');
          this.num++;
        }
      },
      updated: function () {
        console.log('我是原生的update');
      },
      extends: extendsObj,
      delimiters:['${','}']
      // 修改插值方式
    })
  </script>
</body>

</html>